package com.kapcb.statemachine.builder;

import com.kapcb.statemachine.StateMachine;

/**
 * <a>Title: StateMachineBuilder </a>
 * <a>Author: Kapcb <a>
 * <a>Description: StateMachineBuilder <a>
 *
 * @author Kapcb
 * @version 1.0
 * @date 2024/7/26 22:32
 * @since 1.0
 */
public interface StateMachineBuilder<S, E, C> {

    /**
     * Builder for one transition
     *
     * @return External transition builder
     */
    ExternalTransitionBuilder<S, E, C> externalTransition();

    /**
     * Builder for multiple transitions
     *
     * @return External transition builder
     */
    ExternalTransitionsBuilder<S, E, C> externalTransitions();

    /**
     * Builder for parallel transitions
     *
     * @return External transition builder
     */
    ExternalParallelTransitionBuilder<S, E, C> externalParallelTransition();

    /**
     * Start to build internal transition
     *
     * @return Internal transition builder
     */
    InternalTransitionBuilder<S, E, C> internalTransition();

    /**
     * set up fail callback, default do nothing {@code NumbFailCallbackImpl}
     *
     * @param callback
     */
    void setFailCallback(FailCallback<S, E, C> callback);

    StateMachine<S, E, C> build(String machineId);
}
